
// 1 sequence for hnting 
// .. 
CWorldDA = function() {
	this.objName = 'CWorldDA: '; // class type informative 
	this.DAsArr = [];
	this.x = 1;
	this.y = 1;
	
	
	// pv +
	
	this.UsMaps = [ 
	// eum
		[11,4],[ 11, 11],   [18, 11], [4,11],[11,18],
	// Ino 	
		[11,32], [4,39], [ 11, 39], [18, 39],[11,46],
	//Leda
		[39,32], [32,39], [ 39, 39], [46, 39],[39,46],
		];
	this.usMapIdx = 0;
	this.UsArr = [];
	this.dainfo = { x:1, y:1};
};




CWorldDA.prototype = {

/*
	startWorldScan_old: function(cb_complete) {
		this.cb_complete = cb_complete;
		
		var curCstl = CDB.getCurUserCtsl()[0]; 
		this.range = CDB.getCurUserOptions().range;
		
		debug.log(this, retName(this), ' curCstl.x  ', curCstl.x ,' curCstl.y ', curCstl.y );
		// set initial x, y 
		this.x = curCstl.x - Math.floor(this.range/2); 
		this.y = curCstl.y - Math.floor(this.range/2);
		
		if ( this.x < 1 ) this.x +=280;
		if ( this.y < 1 ) this.y +=280;
		

		this.minx = this.x;
		this.miny = this.y;
		this.maxx = this.x + this.range;	
		this.maxy = this.y + this.range;	

		if ( this.maxx > 280 ) this.maxx -=280;
		if ( this.maxy > 280 ) this.maxy -=280;
	
		debug.log(this, retName(this), ' minx  ', this.minx ,' this.miny ', this.miny ,
			'this.maxx' , this.maxx, 'this.maxy' ,this.maxy);						
		// start first 
		this.doWMap({x: this.x, y:this.y});	// first 
	},*/

	

	// pvp specific : temp 
	scanWorldVictom_PVP: function(dfd) {
		
		var dfd = this.dfd_WorldScan =  $.Deferred();


		// reset ... vars 
		this.usMapIdx = 0;
		this.UsArr = [];
		
		debug.log(this, retName(this), ' minx  ', this.minx ,' this.miny ', this.miny ,
			'this.maxx' , this.maxx, 'this.maxy' ,this.maxy);						

		// start first 
		var coodi = this.UsMaps[0];
		this.doWMap_PVP( coodi );	// first
		
		return dfd.promise(); 
	},


	
	doWMap_PVP: function(coodi ) {
		var outer = this;
		 // make world param  
		debug.log(this, retName(this), ' start ');
		
		// complete check !!	
		if ( coodi == undefined ) {
			// complete !!
			debug.log(this, ' Done  ' , this.DAsArr);
			
			// sort !!
			outer.UsArr.sort( function(a,b) {
				//  time order 
				return a.nextdate.getTime() - b.nextdate.getTime(); 
			});
			
			// print !! 
			// this.printDAsArr();
			$.each( outer.UsArr, function(_, us) {
						em.util.print_result(  us.name + ' x:' + us[0] + ',y:' + us[1] + ' lv:' + us.lv 
						   + ' dur:' + us.dur  + ' next:' + CUtil.TimeToString (us.nextdate) ) ;
			});

						
			// done cb 
			outer.dfd_WorldScan.resolve();
			return;
		}
		
		function extractUS(usarr) {
			debug.log(outer, ' extractUS  ' , usarr);

				var usArr = usarr.filter ( function(el){
					return el[2] == -1; 
				});
				
					// push  all usr with endtime 
					/*
					// sleep 
					[48,37,-1,[331,"[Led] \uc591\uc1a1\uc774",1,
					28,  // lv 
					"Leda",4,5,68,0,4,331,"\uc591\uc1a1\uc774",[0,0,null,5],
					// sleep time  , du ,  next 
					41648,96,0]],
					
					// not sleep 
						0,93,1802]
					*/
					
				$.each( usArr , function(_, us) {
					var lv = us[3][3];
					
					// except hip server 
					var serverC =  us[3][1][1];
					if ( serverC == "H") return false; 
					
					var name = us[3][1];
					var sleeptime = us[3][13];
					var sleepdate = new Date( $.now() + (sleeptime - 15) * 1000) ;
					var dur = us[3][14];
					var nexttime = us[3][15];
					
					// if sleep ,, set next time with wake up time 
					if ( sleeptime != 0  ) {
						nexttime = sleeptime;
					}					
					// set - sec  for early att. 
					var nextdate = new Date( $.now() + (nexttime) * 1000) ;
					

					$.extend( us, {'lv': lv, x: us[0], y: us[1], 'name': name,   
									'sleepdate': sleepdate, 'dur': dur, 'nextdate': nextdate});
					outer.UsArr.push( us);
				});
					
					
				function nextMapxy_PVP() {
					outer.usMapIdx ++;
					if ( outer.usMapIdx  >= outer.UsMaps.length) {
						// end !!
						return undefined;	
					}
					
					debug.log(outer,  ' cur Map coodoi  ', outer.UsMaps[outer.usMapIdx] ,outer.usMapIdx );
					return outer.UsMaps[outer.usMapIdx];
				};
					
					// go next map co odi
					outer.doWMap_PVP.call( outer, nextMapxy_PVP() ); 
			};
		
		debug.log(this, ' Search V : ' , coodi);
		 var param = { x: coodi[0] , y: coodi[1] , cb : extractUS};
		 em.ahelper.worldMap(param);
	},
	
	getUsArr:  function() {
		return this.UsArr;
	},
	getBestUs: function() {
		return {'lv': 10, x: 19, y: 12, 'name': 'bbbb',   'sleepdate': 0, 'dur': 90, 'nextdate': 0};
	},
	
/*
	
	// pvp 
	nextMapxy: function() {
		
		this.x += 7; 		// right move 
		
		if ( this.x >= 56 ) {
			this.x =1;
			this.y += 7;
		}

		if (this.y >= 56 ) {
			// end !!
			return undefined;
		}
		
		debug.log(this, retName(this), ' this.x  ', this.x ,' this.y ', this.y );
				
		return {x: this.x, y:this.y};
		
	},
	*/
/*
	startWorldScan: function(dfd) {
		
		var dfd = this.dfd_WorldScan =  $.Deferred();
		
		var curCstl = CDB.getCurUserCtsl()[0]; 
		this.range = CDB.getCurUserOptions().range;
		
		debug.log(this, retName(this), ' curCstl.x  ', curCstl.x ,' curCstl.y ', curCstl.y );

		// reset  var s
		this.DAsArr = [];
		this.myx = curCstl.x; 
		this.myy = curCstl.y;
		 
		// set initial x, y 
		this.x = curCstl.x - Math.floor(this.range/2); 
		this.y = curCstl.y - Math.floor(this.range/2);
		
		if ( this.x < 1 ) this.x +=280;
		if ( this.y < 1 ) this.y +=280;
		

		this.minx = this.x;
		this.miny = this.y;
		this.maxx = this.x + this.range;	
		this.maxy = this.y + this.range;	

		if ( this.maxx > 280 ) this.maxx -=280;
		if ( this.maxy > 280 ) this.maxy -=280;
	
		debug.log(this, retName(this), ' minx  ', this.minx ,' this.miny ', this.miny ,
			'this.maxx' , this.maxx, 'this.maxy' ,this.maxy);						

		// start first 
		this.doWMap({x: this.x, y:this.y});	// first
		
		return dfd.promise(); 
	},
// 



	nextMapxy: function() {
		
		this.x += 7; 		// right move 
	


		debug.log(this, retName(this), ' minx  ', this.minx ,' this.miny ', this.miny ,
			'this.maxx' , this.maxx, 'this.maxy' ,this.maxy);			
			
		// case 1 : minx  < x  < max x 
		// case 2:  max x (10) < x, 280  < min x ( 170)
		var xwrap = false;
		if ( this.maxx > this.minx ) {
			if ( this.x > this.maxx ) xwrap = true; 
		} 
		else if ( this.minx > this.maxx ) {	// case 2
			if ( this.x <=  this.minx && this.x > this.maxx ) {
				xwrap = true;
			}
		}
		
		//after check warp.. 
		if ( this.x > 280 ) this.x -=280;
		
		if (xwrap)
		{		// x | 280 | max  : dist < 0 ,, 占쏙옙湲�  next move 
			this.x = this.minx;
			
			this.y += 7; //

			
			// check end .. 
			if ( ( this.maxy > this.miny &&  this.y > this.maxy ) 	// case 1
				||  ( this.miny > this.maxy &&  this.y <= this.miny && this.y > this.maxy ) ) {		// case 2
					return undefined;	// last !! done!!	
				}
		}
		
		// after check end . 
		if ( this.y > 280 ) this.y -=280;
		debug.log(this, retName(this), ' this.x  ', this.x ,' this.y ', this.y );
		
		return {x: this.x, y:this.y};
	},
	
*/

// version 3 :  just do all map !!!
	startWorldScan: function(dfd) {
		
		var dfd = this.dfd_WorldScan =  $.Deferred();
		

		// reset  var s
		this.DAsArr = [];
		this.myx = 1; 
		this.myy = 1;
		 this.range = 279;
		// set initial x, y 
		this.x = 1; 
		this.y = 1;
		
		if ( this.x < 1 ) this.x +=280;
		if ( this.y < 1 ) this.y +=280;
		

		this.minx = this.x;
		this.miny = this.y;
		this.maxx = this.x + this.range;	
		this.maxy = this.y + this.range;	

		if ( this.maxx > 280 ) this.maxx -=280;
		if ( this.maxy > 280 ) this.maxy -=280;
	
		debug.log(this, retName(this), ' minx  ', this.minx ,' this.miny ', this.miny ,
			'this.maxx' , this.maxx, 'this.maxy' ,this.maxy);						

		// start first 
		this.doWMap({x: this.x, y:this.y});	// first
		
		return dfd.promise(); 
	},
// 



	nextMapxy: function() {
		var xwrap = false;
		this.x += 7; 		// right move 
		debug.log(this, retName(this), ' minx  ', this.minx ,' this.miny ', this.miny ,
			'this.maxx' , this.maxx, 'this.maxy' ,this.maxy);			
		
		
		//after check warp.. 
		if ( this.x > 280 ) {
			this.x =1;
			xwrap = true;
		}
		
		if (xwrap)
		{		// x | 280 | max  : dist < 0 ,, ��긽   next move 
			this.y += 7; //
				// after check end . 
			if ( this.y > 280 ){
				this.y =1;
				return undefined;	// last !! done!!	
			} 
		}
		
		debug.log(this, retName(this), ' this.x  ', this.x ,' this.y ', this.y );
		
		return {x: this.x, y:this.y};
	},
	


	getWorldDA: function() {
		
		this.doWMap(this.nextMapxy());
		
	},

	aggrigateDA: function (da_arr) {

		var outer = this;
		
		var wantstars = CDB.getCurUserOptions().wantstars;
		
		var trans_str  = [0,6,5,4,3,2,1];	// 6 start = 1
		var arr_star = 0;
		var trans_wantstart = [];
		$.each(wantstars, function(i,star) {
			trans_wantstart[i] = trans_str[star];
		});
		// check cur co odi  is valid 
		$.each( da_arr,  function (i, item) {
			if ( $.inArray(item[2], trans_wantstart)  > -1) {
				// check ok. valid !! 
				debug.log(outer, "x: " + item[0] + " Y : " + item[1] + " star: " + item[2] + "quater: "+ item[3]);
				// push arr 
				arr_star = item[2]-1;
				if ( ! outer.DAsArr[arr_star] ) {
					outer.DAsArr[arr_star] = [];
				}
				debug.log(outer, ' aggrigateDA ' , item, 'arr_star', arr_star);
				outer.DAsArr[arr_star].push(item);
			}
		});
		
		// go next map co odi 
		this.getWorldDA();
	},
	
	// DA Array 占쎌뮋�숂뛾�녿즵占쏙옙   this �띠룊�셛aller...  window �띠룇鍮섊뙼占��띠룊�쇿뜝�숈삕  
	gotWmap: function(da_arr) {
		
		em.worldDA.aggrigateDA.call(em.worldDA, da_arr);
		
	
	},
	
	doWMap: function(dainfo ) {
		 // make world param  
		debug.log(this, retName(this), ' start ');
		
		// complete check !!	
		if ( dainfo == undefined ) {
			// complete !!
			debug.log(this, ' Done  ' , this.DAsArr);
			
			// sort !! 
			this.sortDAsArr();
			
			// print !! 
			this.printDAsArr();
						
			// done cb 
			this.dfd_WorldScan.resolve();
			return;
		}
		
		 var param = { x: dainfo.x , y: dainfo.y , cb : this.gotWmap};
		 em.ahelper.worldMap(param);
		// em.ahelper.worldMap(this.nextMapxy());
	},
		
	sortDAsArr: function() {
		var my_x = this.myx;
		var my_y = this.myy;
		$.each( this.DAsArr, function(_, DaArr) {
			if ( DaArr == undefined) return;
			DaArr.sort(function(a,b){
					//  max 처리 .!!!   10 <- 280 - > 260 :  30 !! 
					// 10 - 260  ; 250 ,   280 - 250 : 30  ,  min ( 250, 30)
					//  50 , 80 : 50 -80 : 30,    280 - 30 = 250 ; 
					// 160, 280 : 120 ,  280 - 120 : 160 
					var diff_ay = Math.min( Math.abs(my_y -a[1]) ,  280 - Math.abs(my_y - a[1])  );
					var diff_ax = Math.min( Math.abs(my_x -a[0]) ,  280 - Math.abs(my_x -a[0])  );

					var diff_by = Math.min( Math.abs(my_y -b[1]) ,  280 - Math.abs(my_y - b[1])  );
					var diff_bx = Math.min( Math.abs(my_x -b[0]) ,  280 - Math.abs(my_x -b[0])  );
					
					var dis_a = Math.pow(diff_ax,2) + Math.pow( diff_ay, 2) ;
					var dis_b = Math.pow(diff_bx,2) + Math.pow( diff_by, 2) ;
					
					// var dis_a = Math.pow(Math.abs(my_x - a.x ),2) + Math.pow( Math.abs(my_y- a.y), 2) ;
					// var dis_b = Math.pow(Math.abs(my_x - b.x ),2) + Math.pow( Math.abs(my_y- b.y), 2) ;
					return dis_a - dis_b;
				}); 
		});
	},

	printDAsArr: function() {
		em.util.print_result(" [ ") ;
		$.each( this.DAsArr, function(_, DaArr) {
			if ( DaArr == undefined) return;
			em.util.print_result( '    [') ;
			$.each(DaArr, function(_,da) {
				em.util.print_result( ' { x:' + da[0] + ',y:' + da[1] + '},') ;
			});
			em.util.print_result( '     ],') ;
		});
		em.util.print_result(" ]; ") ;
	},
};


// Expert Info (Chat/Sequence): 
// GET /game/api_world_map.php?jsonpcallback=jsonp1322034289959\
// &_=1322034437410
// &key=3badb54bda7e38920062ad493d1c9944
// &x=224&y=250
// &_l=en HTTP/1.1\r\n



// 222/ 252 : 3 star 4 
// 224/ 253  :4 start 29


// /soldier_educate_api.php?jsonpcallback=jsonp1321974261717&_=1321974450455
//&key=a0ec2950f34992bd4d5db145cfea95d3
//&city=3070&_l=en&_p=EW-DROID

/*
2: sp
8 : lanu
15 : ov
17: k
jsonp1321974261717(
{"code":0,
"ret":
{"soldiers":
[[1,0,1],[2,121,1],[3,0,1],[4,0,1],[5,0,1],[6,0,1],[7,0,1],[8,1528,1],[9,0,1],[10,12,1],[11,0,1],[12,0,1],[13,0,1],[14,0,1],[15,2077,1],[16,0,1],[17,2699,1],[18,1,1]],
"space":6562,"head":8356,"def":1,"next":[0,0],"f":-38261}})
*/



/*
 armament_action_do_api.php?
 jsonpcallback=jsonp1321974261718&_=1321974460167&key=a0ec2950f34992bd4d5db145cfea95d3
 &city=3070
 &action=do_war
 &attack_type=3
 &tai_num=3
 &area=184&area_x=53
 &_l=en
 &_p=EW-DROID


jsonp1321974261718(
{"code":0,
"ret":
{"carry":180,"cost_food":180,"cost_wood":0,"cost_iron":0,"cost_gold":0,"distance":2040,"travel_sec":0}})
*/



/*

get_cityinfo_api.php?
jsonpcallback=jsonp1321974267349&_=1321974460196&key=a0ec2950f34992bd4d5db145cfea95d3
&city=3070
&_l=en
&_p=EW-DROID


2 : remain area
192 : area
484741,21213527,2915768,21213527,220137,21213527,1075887,21213527,  : resource  cur / max
9652,9644, : popul
5,5,5,29, :  farm
18,26,24,22,13,24,18,  : structure   town, bar, wall, arena, storage,  research, fucility

jsonp1321974267349(
{"code":0,
"ret":
{"city":
[2,193,
	484741,21213527,2915768,21213527,220137,21213527,1075887,21213527, //9
	9652,9644, 	//11
	5,5,5,29,		//15
	18,26,24,22,13,24,18,   // 22
	[{"id":39545,"itemid":166,"secs":118075}, //23
		{"id":40536,"itemid":166,"secs":462108},
		{"id":40819,"itemid":120,"secs":45057}]
	,0],
	"grade":62,"money":0}
}
)
*/


/*
 // 
 armament_action_task_api.php?
 jsonpcallback=jsonp1321974261719&_=1321974468658&key=a0ec2950f34992bd4d5db145cfea95d3
 &city=3070
	 &action=war_task
 &attack_type=3&tai_num=3
 	&area=184&area_x=53
 &_l=en
 &_p=EW-DROID
 &carry=180&cost_food=180&cost_wood=0&cost_iron=0&cost_gold=0&distance=2040&travel_sec=0


jsonp1321974261719(
{"code":0,
"ret":
	{"cd":
	[{"id":3281779,"cdtype":4,"target":3,"owner":0,"secs":0,"ret":0,"ext":"184\/53"}]
	}
}
)

*/



/*
get_cdinfo_api.php?
jsonpcallback=jsonp1321974261720&_=1321974470536&key=a0ec2950f34992bd4d5db145cfea95d3
&city=3070
&_l=en
&_p=EW-DROID


jsonp1321974261720(
{"code":0,
"ret":
	{"cdlist":
		[
			{"id":757395,"cdtype":1,"target":4,"owner":0,"secs":170134},
			{"id":780811,"cdtype":1,"target":9,"owner":0,"secs":504194},
			{"id":805491,"cdtype":0,"target":5,"owner":0,"secs":5220},
			{"id":206987,"cdtype":2,"target":5,"owner":26106,"secs":58628}],
			"grade":62,"money":0}}
)


jsonp1322324405844({"code":0,"ret":{"cdlist":[
{"id":780811,"cdtype":1,"target":9,"owner":0,"secs":143925},
{"id":816822,"cdtype":1,"target":5,"owner":0,"secs":9504},
{"id":3432845,"cdtype":4,"target":7,"owner":71,"secs":29,"ret":0,"ext":"147\/63"}],"grade":62,"money":0}})
*/


/*
message_api.php?
jsonpcallback=jsonp1321974261721&_=1321974484078&key=a0ec2950f34992bd4d5db145cfea95d3
&page=1
&_l=en
&_p=EW-DROID


jsonp1321974261721(
{"code":0,
"ret":
	{"mail":
		[
			{"id":"473273","sender":"sys","title":"\u2605\u2605 \uacc4\uc88c\uc774\uccb4 \uc82c \uad6c\ub9e4 \ubc29\ubc95 \/ \uc9c0\uae09 \uc2dc\uac04 \u2605\u2605","time":1321968210,"new":1},{"id":"471036","sender":"sys","title":"\u2605\u2605 \uacc4\uc88c\uc774\uccb4 \uc82c \uad6c\ub9e4 \ubc29\ubc95 \/ \uc9c0\uae09\uc2dc\uac04 \u2605\u2605","time":1321925649,"new":1},
			{"id":"470279","sender":"sys","title":"Famine happens in Castle [185\/53]!","time":1321913471,"new":0},{"id":"469881","sender":"sys","title":"NO Food in Castle [185\/53]!","time":1321889675,"new":1},{"id":"469772","sender":"sys","title":"Eliminated by [Led] adam in PVP","time":1321886003,"new":1},{"id":"468104","sender":"sys","title":"\u2605\u2605 \uacc4\uc88c\uc774\uccb4 \uc82c \uad6c\ub9e4 \ubc29\ubc95 \/ \uc9c0\uae09 \uc2dc\uac04 \u2605\u2605","time":1321842417,"new":1},
			{"id":"468103","sender":"\uae40\uc120\uc9c4","title":"24\uc77c \ubaa9\uc694\uc77c 18\uc2dc \ud734\uc804\ud574\uc81c","time":1321838344,"new":0},{"id":"467545","sender":"sys","title":"[185\/53]\uc131 \ub0b4\uc5d0 \uc2dd\ub7c9\uc774 \uc5c6\uc2b5\ub2c8\ub2e4!","time":1321829813,"new":1},{"id":"466090","sender":"sys","title":"Resource Colony 4\/72 is expired","time":1321791198,"new":1},{"id":"467552","sender":"\ud751\uc778","title":"\ud751\uc778\ub18d\uc7a5 \uc0ac\uc6a9\ubc29\ubc95","time":1321762518,"new":0},
			{"id":"467551","sender":"\ud751\uc778","title":"\ud751\uc778\ub18d\uc7a5 \uc0ac\uc6a9\ubc29\ubc95","time":1321762510,"new":0},{"id":"467550","sender":"\uae40\uc120\uc9c4","title":"\uc0ac\uce6d\uc8fc\uc758","time":1321762288,"new":0},{"id":"467549","sender":"\ud751\uc778","title":"\uc8fc \ud751\uc778\ub18d\uc7a5\uac1c\uc5c5 \uc0ac\uc6a9\ubc29\ubc95","time":1321762278,"new":0},{"id":"467548","sender":"\ud751\uc778","title":"(\uc8fc) \ud751\uc778\ub18d\uc7a5 \uac1c\uc5c5","time":1321762183,"new":0},{"id":"467547","sender":"\ud751\uc778","title":"\ub2e4\ub4e4 \uc218\uc1a1\ud301 \ub2e4\uc2dc-\ucd5c\uc885\uc801","time":1321759625,"new":0},{"id":"467546","sender":"sys","title":"\u2605\u2605 \uacc4\uc88c\uc774\uccb4 \uc82c \uad6c\ub9e4 \ubc29\ubc95 \/ \uc9c0\uae09 \uc2dc\uac04 \u2605\u2605","time":1321755594,"new":1},{"id":"462487","sender":"sys","title":"\u2605\u2605 \uacc4\uc88c\uc774\uccb4 \uc82c \uad6c\ub9e4 \ubc29\ubc95 \/ \uc9c0\uae09 \uc2dc\uac04 \u2605\u2605","time":1321680488,"new":1},{"id":"462486","sender":"sys","title":"\u2605\u2605 \uacc4\uc88c\uc774\uccb4 \uc82c \uad6c\ub9e4 \ubc29\ubc95 \/ \uc9c0\uae09 \uc2dc\uac04 \u2605\u2605","time":1321677413,"new":1},{"id":"462485","sender":"sys","title":"\u2605\u2605 \uacc4\uc88c\uc774\uccb4 \uc82c \uad6c\ub9e4 \ubc29\ubc95 \/ \uc9c0\uae09 \uc2dc\uac04 \u2605\u2605","time":1321675795,"new":1},
			{"id":"462484","sender":"sys","title":"\u2605\u2605 \uacc4\uc88c\uc774\uccb4 \uc82c \uad6c\ub9e4 \ubc29\ubc95 \/ \uc9c0\uae09 \uc2dc\uac04 \u2605\u2605","time":1321675492,"new":1}
			],
			"max":2}})
*/


/*

/war_result_list_api.php?
jsonpcallback=jsonp1321974261722&_=1321974489374&key=a0ec2950f34992bd4d5db145cfea95d3
&page=1
&type=3
&_l=en
&_p=EW-DROID


jsonp1321974261722(
{"code":0,
	"ret":
		{"war":
			[
			{"id":3276196, // id !! 
				"type":3,"aid":3074,"did":0,"aname":"james!!","dname":null,
				"acid":3070,"dcid":0,
					"acity":"\ucc9c\uc0c1\uc131",
					"dcity":"\ucc9c\uc0c1\uc131",
					"ax":185,"ay":53,
					
					"dx":184,"dy":53, // coodi 

					"flag":1,
					"time":1321974150,
					"new":1}
			],"max":1}})
*/


/*

war_result_info_api.php?
jsonpcallback=jsonp1321974261723&_=1321974497945&key=a0ec2950f34992bd4d5db145cfea95d3
&id=3276196		// id
&_l=en
&_p=EW-DROID



// Horror(694)
jsonp1321974261723({
"code":0,
"ret":
	{
		"war_report":null,
		"scout_report":
			{"flag":0,
			"result":
			"<b>[Hero]<\/b><br\/>ChaosSlave (Lvl.3)<br\/><br\/><b>[Troops]<\/b><br\/>Horror(694)<br>Attack(15)&nbsp;&nbsp;Defense(8)&nbsp;&nbsp;Health(80)<br><br>"},
			"other_report":null}})
*/


/*
api_fav.php?
jsonpcallback=jsonp1321974261724&_=1321974513522&key=a0ec2950f34992bd4d5db145cfea95d3
&act=addreport
&wid=3276196&cat=2
&_l=en&_p=EW-DROID

jsonp1321974261757(
{"code":0,"ret":""}
)
*/





// james song
/*

/game/api_world_map.php?jsonpcallback=jsonp1322055723835&_=1322055832019&key=3badb54bda7e38920062ad493d1c9944&x=203&y=250&_l=en HTTP/1.1
curl "k2.emrosswar.com/game/api_world_map.php?jsonpcallback=jsonp1322055723835&_=1322055832019&key=3badb54bda7e38920062ad493d1c9944&x=203&y=250&_l=en" -A "Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"


/game/armament_action_do_api.php?jsonpcallback=jsonp1322055723836&_=1322055842519&key=3badb54bda7e38920062ad493d1c9944&city=14281&act=anum&x=204&y=251&_l=en HTTP/1.1
 curl "k2.emrosswar.com/game/armament_action_do_api.php?jsonpcallback=jsonp1322055723836&_=1322055842519&key=3badb54bda7e38920062ad493d1c9944&city=14281&act=anum&x=204&y=251&_l=en" -A "Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"


GET /game/soldier_educate_api.php?jsonpcallback=jsonp1322055723837&_=1322055842552&key=3badb54bda7e38920062ad493d1c9944&city=14281&_l=en HTTP/1.1
 curl "k2.emrosswar.com/game/soldier_educate_api.php?jsonpcallback=jsonp1322055723837&_=1322055842552&key=3badb54bda7e38920062ad493d1c9944&city=14281&_l=en" -A "Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"


 GET /game/get_cityinfo_api.php?jsonpcallback=jsonp1322055727502&_=1322055852675&key=3badb54bda7e38920062ad493d1c9944&city=14281&_l=en HTTP/1.1
 curl "k2.emrosswar.com/game/get_cityinfo_api.php?jsonpcallback=jsonp1322055727502&_=1322055852675&key=3badb54bda7e38920062ad493d1c9944&city=14281&_l=en" -A "Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"


GET /game/gen_conscribe_api.php?jsonpcallback=jsonp1322055723838&_=1322055873776&key=3badb54bda7e38920062ad493d1c9944&city=14281&action=gen_list&extra=1&_l=en HTTP/1.1
 curl "k2.emrosswar.com/game/gen_conscribe_api.php?jsonpcallback=jsonp1322055723838&_=1322055873776&key=3badb54bda7e38920062ad493d1c9944&city=14281&action=gen_list&extra=1&_l=en" -A "Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"

jsonp1322055723838({"code":0,"ret":{"hero":[
{"id":9176,"gid":210,"p":44,"i":8,"c1":17,"f":34,"g":12,"c2":613,"fy":0,"s":0,"e":10,"w":0,"tw":30,"tl":79,
	"ex":59758,"te":257100,"np":0,"ni":0,"nc1":0,"nc2":0,"ns":0,"ncd":0,"pr":36000},
{"id":20635,"gid":185,"p":10,"i":40,"c1":13,"f":50,"g":11,"c2":559,"fy":0,"s":0,"e":10,"w":0,"tw":0,"tl":89,"ex":106717,"te":116863,"np":0,"ni":0,"nc1":0,"nc2":0,"ns":0,"ncd":0,"pr":33000},{"id":24349,"gid":142,"p":18,"i":26,"c1":18,"f":38,"g":4,"c2":354,"fy":0,"s":0,"e":10,"w":1,"tw":12,"tl":7,"ex":398,"te":468,"np":0,"ni":0,"nc1":0,"nc2":0,"ns":0,"ncd":0,"pr":12000},{"id":81059,"gid":200,"p":22,"i":10,"c1":15,"f":50,"g":3,"c2":299,"fy":0,"s":0,"e":10,"w":0,"tw":0,"tl":1,"ex":0,"te":212,"np":0,"ni":0,"nc1":0,"nc2":0,"ns":0,"ncd":0,"pr":9000}]}})

GET /game/armament_action_do_api.php?jsonpcallback=jsonp1322055723839&_=1322055884101&key=3badb54bda7e38920062ad493d1c9944&city=14281&action=do_war&attack_type=7&gen=185&area=204&area_x=251&soldier_num2=33&_l=en HTTP/1.1
 curl "k2.emrosswar.com/game/armament_action_do_api.php?jsonpcallback=jsonp1322055723839&_=1322055884101&key=3badb54bda7e38920062ad493d1c9944&city=14281&action=do_war&attack_type=7&gen=185&area=204&area_x=251&soldier_num2=33&_l=en" -A "Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"

GET /game/armament_action_task_api.php?jsonpcallback=jsonp1322055723840&_=1322055886719&key=3badb54bda7e38920062ad493d1c9944&city=14281&action=war_task&attack_type=7&gen=185&area=204&area_x=251&soldier_num2=33&_l=en&carry=1980&cost_food=1980&cost_wood=0&cost_iron=0&cost_gold=0&distance=2160&travel_sec=300 HTTP/1.1
 curl "k2.emrosswar.com/game/armament_action_task_api.php?jsonpcallback=jsonp1322055723840&_=1322055886719&key=3badb54bda7e38920062ad493d1c9944&city=14281&action=war_task&attack_type=7&gen=185&area=204&area_x=251&soldier_num2=33&_l=en&carry=1980&cost_food=1980&cost_wood=0&cost_iron=0&cost_gold=0&distance=2160&travel_sec=300" -A "Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
*/